package com.example.sugar.mapper;

import com.example.sugar.bean.UserLoginBean;
import com.example.sugar.bean.UserTypeBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserStatsMapper {
    @Select("SELECT sum(back_ct)\n" +
            "FROM dws_user_user_login_window\n" +
            "WHERE toYYYYMMDD(stt) = #{date}")
    Integer selectTotalAmount(@Param("date") Integer date);

    @Select("select sum(detail_ct) detail_ct,\n" +
            "sum(page_ct) page_ct,\n" +
            "sum(cart_ct) cart_ct,\n" +
            "sum(pay_ct) pay_ct\n" +
            "from dws_user_user_action_window\n" +
            "WHERE toYYYYMMDD(stt) = #{date}")
    UserTypeBean selectUserAction(@Param("date") Integer date);


    @Select("select sum(ur_ct) ur_ct,\n" +
            "sum(uv_ct) uv_ct\n" +
            "from dws_user_user_regiter_window\n" +
            "WHERE toYYYYMMDD(stt) = #{date}")
    UserLoginBean selectUserLogin(@Param("date") Integer date);


}
